FROM openjdk:8-jdk
LABEL maintainer=zmc

COPY target/*.jar /app.jar

ENV PARAMS="--server.port=8080 --spring.profiles.active=prod --spring.cloud.nacos.discovery.server-addr=nacos-headless:8848 --spring.cloud.nacos.discovery.username=nacos --spring.cloud.nacos.discovery.password=nacos --spring.cloud.nacos.discovery.namespace=6a658a6f-3092-41ac-980e-22d96b86a9a8 --spring.cloud.nacos.config.server-addr=nacos-headless:8848 --spring.cloud.nacos.config.namespace=prod --spring.cloud.nacos.config.file-extension=yml"

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone && touch /app.jar

ENTRYPOINT ["/bin/sh", "-c","java -Djava.security.egd=file:/dev/./urandom -jar app.jar ${PARAMS}"]